package com.ruoyi.common.utils;

import java.util.HashMap;


public class MapPro extends HashMap<String, Object>{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3500151862478696281L;

	/**
	 * 获取string，如果为空，返回""
	 * @param key
	 * @return
	 */
	public String getStr(String key)
	{
		if(StrKit.notBlank(key)){
			String res = (String) get(key);
			return res;
		}else{
			return "";
		}
	}
	
	/**
	 * 返回Long，如果为空，返回-1
	 * @param key
	 * @return
	 */
	public long getLong(String key)
	{
		if(StrKit.notBlank(key)){
			long res = (long) get(key);
			return res;
		}else{
			return -1;
		}
	}
	
	/**
	 * 返回int，如果为空，返回-1
	 * @param key
	 * @return
	 */
	public int getInt(String key)
	{
		if(StrKit.notBlank(key)){
			int res = (int) get(key);
			return res;
		}else{
			return -1;
		}
	}

}
